package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.ReturnMapper;
import com.example.shoppingmall.pojo.Return;
import com.example.shoppingmall.pojo.Returnmethod;
import com.example.shoppingmall.pojo.Rrturnstatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ReturnService{
    @Autowired
    ReturnMapper returnMapper;


    public List<Return> getreturns(String reno,String returnno, String rorderno, String rphone, String logisticsno, String status, Integer pageno, Integer pageSize) {
        return returnMapper.getreturns(reno,returnno, rorderno, rphone, logisticsno, status, pageno, pageSize);
    }

    public int returncount(String returnno, String rorderno, String rphone, String logisticsno, String status) {
        return returnMapper.returncount(returnno, rorderno, rphone, logisticsno, status);
    }






    //退款单列表
    //多条件查询+分页
    public List<Return> getRet(String returnno,String username, String rphone, Integer rstatus,
                               Integer pageNo, Integer pageNum){
        return returnMapper.getRet(returnno,username, rphone, rstatus, pageNo, pageNum);
    }

    //查询总条数
    public int total(String returnno,String username, String rphone,Integer rstatus){
        return returnMapper.total(returnno,username, rphone, rstatus);
    }

    //修改
    public int update(Return returns){
        return returnMapper.update(returns);
    }

    //根据id查询
    public Return toRet(Integer id){
        return returnMapper.toRet(id);
    }

    //查询退款状态
    public List<Rrturnstatus> getReSta(){
        return returnMapper.getReSta();
    }

    //查询退款方式
    public List<Returnmethod> getReMet(){
        return returnMapper.getReMet();
    }
}
